package handler

import (
	"web_framework/model"
	"web_framework/pkg/constvar"
)

//推送下载任务队列响应接口
type StorageFileScanHandle struct {
}

func (storageFileScanHandle StorageFileScanHandle) handleMsg(data model.Request, sn string) (result model.Response) {
	//更新任务状态
	//for _, task := range data.Data.Tasks {
	//	taskIdStr := strconv.Itoa(task.TaskID)
	//	taskInfoCacheKey := storage.RedisRouterTaskInfoKey + sn + ":" + taskIdStr
	//	taskStatus,getInfoErr := storage.RedisHGet(taskInfoCacheKey,"status")
	//	if getInfoErr != nil{
	//		log.Error(strconv.Itoa(data.Mtype)+ "_" + taskIdStr + "_" + "任务详情查询失败")
	//		continue
	//	}
	//	intStatus, _ := strconv.Atoi(taskStatus)
	//
	//	if intStatus == model.TaskStatusDeal{
	//		//TODO   根据下载模块传过来的任务状态，更新任务队列状态
	//		if err := service.UpdateQueueTaskStatus(int64(task.TaskID), sn, model.TaskStatusloading); err != nil {
	//		}
	//	}
	//}

	return model.Response{
		Mid:    data.Mid,
		Mtype:  data.Mtype,
		Status: constvar.StatusOk,
	}
}
